# Implement pow(x, n).
# @author:timlentse(tinglenxan@gmail.com)
# @Date:2014-11-18

    # @param x, a float
    # @param n, a integer
    # @return a float
def implementationOfPow(x,n):
    if x==0.0:
        return 0
    #No recursive but loop
    else:
        if n == 0: return 1.0
        else:
            value = x
            count =  n/2 if n>0 else -n/2
            print count
            while (count):
                if count%2==0:
                    value *= value
                else:
                    value *= value*x
                count /= 2
    return value if n>0 else 1/value 
#"""        
print implementationOfPow(2.0,-4)